package com.bd08.flink.demo.jing

import org.apache.flink.api.java.aggregation.Aggregations
import org.apache.flink.api.scala.ExecutionEnvironment
import org.apache.flink.streaming.api.scala.createTypeInformation

object AggDemo extends App {
  val benv = ExecutionEnvironment.getExecutionEnvironment
  val ds=benv.fromCollection(List("a","b","c","d","a","c"))


  ds.map((_,1)).aggregate(Aggregations.SUM,1).print()


  ds.map((_,1)).groupBy(0).aggregate(Aggregations.SUM,1).print()
//
//
  ds.map((_,1)).groupBy(0).sum(1).max(1).print()


}
